﻿using System;
using System.Collections.Generic;
using System.Text;

namespace time
{
    public class 猜数字
    {
        
        public static void Caishuzi()
        {
            Random ra = new Random();
            int a = ra.Next(1, 10);
            Console.WriteLine("五次机会 10以内的数字");

            string strB = "";

            for (int i = 0; i < 5; i++)
            {
                strB = Console.ReadLine();
                int intB = Convert.ToInt32(strB);
                if (intB == a)
                {
                    Console.WriteLine("哈哈 今天运气好 正确答案:" + a.ToString() + "");
                    return;
                }
                else {
                    Console.WriteLine("不正确");
                }
                
                //Console.Write("\n");
            }

            Console.WriteLine("今天运气不好");
        }

    }
}
